﻿namespace MiP.Xml.Core.StringEvaluation
{
    internal class ReadToDollarEvaluationState : EvaluationState
    {
        internal override EvaluationState Next(EvaluationContext context)
        {
            char currentChar = context.ReadNextChar();
            if (currentChar != '$')
            {
                context.Result.Append(currentChar);
                return this;
            }

            context.Incomplete.Append("$");

            return new FoundDollarEvaluationState();
        }
    }
}